package com.ysqcould.Community.service.impl;

import com.ysqcould.Community.domain.SocDonationAmount;
import com.ysqcould.Community.mapper.SocDonationAmountMapper;
import com.ysqcould.Community.service.ISocDonationAmountService;
import com.ysqcould.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 慈航捐赠金额Service业务层处理
 * 
 * @author jcd
 * @date 2022-09-21
 */
@Service
public class SocDonationAmountServiceImpl implements ISocDonationAmountService 
{
    @Autowired
    private SocDonationAmountMapper socDonationAmountMapper;

    /**
     * 查询慈航捐赠金额
     * 
     * @param id 慈航捐赠金额主键
     * @return 慈航捐赠金额
     */
    @Override
    public SocDonationAmount selectSocDonationAmountById(Long id)
    {
        return socDonationAmountMapper.selectSocDonationAmountById(id);
    }

    /**
     * 查询慈航捐赠金额列表
     * 
     * @param socDonationAmount 慈航捐赠金额
     * @return 慈航捐赠金额
     */
    @Override
    public List<SocDonationAmount> selectSocDonationAmountList(SocDonationAmount socDonationAmount)
    {
        return socDonationAmountMapper.selectSocDonationAmountList(socDonationAmount);
    }

    /**
     * 新增慈航捐赠金额
     * 
     * @param socDonationAmount 慈航捐赠金额
     * @return 结果
     */
    @Override
    public int insertSocDonationAmount(SocDonationAmount socDonationAmount)
    {
        socDonationAmount.setCreateTime(DateUtils.getNowDate());
        return socDonationAmountMapper.insertSocDonationAmount(socDonationAmount);
    }

    /**
     * 修改慈航捐赠金额
     * 
     * @param socDonationAmount 慈航捐赠金额
     * @return 结果
     */
    @Override
    public int updateSocDonationAmount(SocDonationAmount socDonationAmount)
    {
        socDonationAmount.setUpdateTime(DateUtils.getNowDate());
        return socDonationAmountMapper.updateSocDonationAmount(socDonationAmount);
    }

    /**
     * 批量删除慈航捐赠金额
     * 
     * @param ids 需要删除的慈航捐赠金额主键
     * @return 结果
     */
    @Override
    public int deleteSocDonationAmountByIds(Long[] ids)
    {
        return socDonationAmountMapper.deleteSocDonationAmountByIds(ids);
    }

    /**
     * 删除慈航捐赠金额信息
     * 
     * @param id 慈航捐赠金额主键
     * @return 结果
     */
    @Override
    public int deleteSocDonationAmountById(Long id)
    {
        return socDonationAmountMapper.deleteSocDonationAmountById(id);
    }
}
